
#pragma once

#include "zdbmain.h"
#pragma warning( disable: 4275 4251 )

#ifdef SCENEOE
#define DLLIMPEXP __declspec(dllexport)
#else
#define DLLIMPEXP
#endif

#include "zAcGiLightTraits.h"
#include "zrxboiler.h"
#include "zdbLight.h"

class UcDbImpSun;
class LIGHTDLLIMPEXP UcDbSun : public UcDbObject
{
public:
    UCRX_DECLARE_MEMBERS(UcDbSun);
private:
    static ZSoft::UInt32 kCurrentVersionNumber;
public:
    UcDbSun();
    ~UcDbSun();
    virtual ZSoft::UInt32 setAttributes(UcGiDrawableTraits* pTraits);
    virtual UcGiDrawable* drawable();
    virtual DrawableType  drawableType() const { return UcGiDrawable::kDistantLight; }
    virtual void          setGsNode(UcGsNode* gsnode);
    virtual UcGsNode*     gsNode() const;
    virtual Ucad::ErrorStatus dxfOutFields(UcDbDxfFiler *pFiler) const;

    virtual Ucad::ErrorStatus dxfInFields (UcDbDxfFiler *pFiler);

    virtual Ucad::ErrorStatus dwgOutFields(UcDbDwgFiler *pFiler) const;

    virtual Ucad::ErrorStatus dwgInFields (UcDbDwgFiler *pFiler);

    virtual Ucad::ErrorStatus decomposeForSave(
            UcDb::UcDbDwgVersion ver,
            UcDbObject*& replaceObj,
            UcDbObjectId& replaceId,
            ZSoft::Boolean& exchangeXData);
    virtual bool isOn() const;
    virtual Ucad::ErrorStatus setOn(bool value);
    virtual double intensity() const;
    virtual Ucad::ErrorStatus setIntensity(double intensity);
    virtual const UcCmColor& sunColor() const;
    virtual Ucad::ErrorStatus setSunColor(const UcCmColor& color);
    virtual const UcGiShadowParameters& shadowParameters() const;
    virtual void setShadowParameters(const UcGiShadowParameters& params);
    virtual Ucad::ErrorStatus setDateTime(const UcDbDate& datetime);
    virtual const UcDbDate& dateTime() const;
    virtual Ucad::ErrorStatus setDayLightSavingsOn(bool value);
    virtual bool isDayLightSavingsOn() const;
    virtual Ucad::ErrorStatus setAzimuth(double azimuth);
    virtual double azimuth() const;
    virtual Ucad::ErrorStatus setAltitude(double altitude);
    virtual double altitude() const;
    virtual const UcGeVector3d& sunDirection() const;
    virtual void setSunDirection(const UcGeVector3d& sundir);
    Ucad::ErrorStatus setSkyParameters(const UcGiSkyParameters& params);
    Ucad::ErrorStatus skyParameters(UcGiSkyParameters& params) const;

private:
    UcDbImpSun * mpUcDbImpSun;
};
